import { createRouter, createWebHashHistory } from "vue-router";

// 主动引入
import home from "@/pages/home/index.vue"

const routes = [
    {
        path: "/",
        name: "home",
        component: home
    },
    {
        path: "/login",
        name: "login",
        // 被动引入 = 异步引入
        component: () => import("@/pages/login/index.vue")
    },
]

// 创建一个路由
const router = createRouter({
    history: createWebHashHistory(),
    routes
})

// 导出路由函数
export default router